package dao;

import bean.Transfer;
import bean.User;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.Connection;

public class LoginTranferDao {


    public boolean password(User user, Connection conn) {
        boolean is = false;
        QueryRunner runner = new QueryRunner();
        String sql = "select * from account where id =? ";
        try {
            Transfer map = runner.query(conn,sql,new BeanHandler<Transfer>(Transfer.class),user.getUserName());
            if (map.getPassword() == Integer.parseInt(user.getPassword())) {
                is = true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return is;
    }
}
